package com.brillilab.service.core.lab;

import com.brillilab.common.entity.PageVo;
import com.brillilab.domain.po.lab.LabMember;
import com.brillilab.domain.vo.lab.LabMemberSelector;
import com.brillilab.domain.vo.lab.LabMemberVo;
import com.brillilab.domain.vo.lab.MemberInfoVo;
import com.brillilab.domain.vo.user.UsersVo;

import java.util.List;

/**
 * 实验室成员Service
 * @author lj
 *
 */
public interface ILabMemberService {
	
	/**
	 * 分页查询实验室成员
	 * @param labId 实验室ID
	 * @param state 成员状态:1-正常，2-移出
	 * @param pageNum 页码
	 * @param pageSize 条数
	 * @return
	 */
	PageVo<LabMemberVo> selectPage(Long labId,Integer state,int pageNum, int pageSize);
	
	/**
	 * 根据权限查询开通/未开通的实验室成员列表
	 * @param labId 实验室ID
	 * @param power 权限名称
	 * @return
	 */
	List<LabMemberVo> selectByPower(Long labId, String power);
	
	/**
	 * 查询实验室成员信息
	 * @param labId 实验室ID
	 * @param userId 用户ID
	 * @return
	 */
	LabMember selectMember(Long labId,Long userId);
	
	/**
	 * 查询实验室成员信息vo
	 * @param labMemberId
	 * @return
	 */
	LabMemberVo selectMemberVo(Long labMemberId);
	/**
	 * 新增实验室成员
	 * @param labMember
	 * @return
	 */
	LabMember add(LabMember labMember);
	/**
     * 判断是否是实验室所有者
     * @param labId
     * @param labMemberId
     * @return
     */
    boolean isOwner(Long labId,Long labMemberId);
    
    LabMember getOwner(Long labId);

	boolean updateById(LabMember labMember);

	boolean updateState(Long id, Integer state);

	LabMember selectById(Long id);

	List<LabMemberVo> selectByLabId(Long labId);

    List<LabMemberVo> selectList(Long labId,Integer state);

	/**
	 * 查询的LabMemberVo只有基础信息
	 * @param labMemberIds
	 * @return
	 */
	List<LabMemberVo> selectBaseVoList(List<Long> labMemberIds);
/**
* @Description: get all by LabId
* @Params: [labId]
* @return java.util.List<com.brillilab.domain.po.lab.LabMember>
* @author wuzhiyu
* @date 2018/11/19 11:40
*/
    List<LabMember> getAllByLabId(Long labId);

    Integer selectCount(Long labId,Integer state);

    List<LabMemberSelector> selectLabMemberSelectorList(Long labId,Integer state);

    LabMember selectByIdAndState(Long labMemberId,Integer value);

    List<LabMember> selectList(List<Long> memberIds);

    //List<LabMemberInfo> selectLabMemberByLabid(Long labid);

    LabMember selectMemberAllState(Long labId,Long userId);

    List<LabMember> selectPoList(Long labId,Integer state);

	List<LabMemberVo> searchLabMember(String name,Long labId);

    List<LabMember> selectListByUserId(Long userId);

	List<LabMember> selectAllByUserId(Long userId);

	/**
	 * 获取指定实验室最新加入的top条成员列表
	 *
	 * @param top   前top条记录
	 * @param labId 实验室Id
	 * @return
	 */
	List<LabMember> getTopLastJoinLabList(Integer top, Long labId);

	/**
	 * 获取指定实验室最新加入的成员列表
	 *
	 * @param labId 实验室Id
	 * @return
	 */
	List<LabMember> getLastJoinLabList(Long labId);

    LabMember selectByLabIdAndUserId(Long labId,Long userId);

	List<UsersVo> selectMemberByPower(Long labId, List<String> powerList);
	
	List<MemberInfoVo> selectMemberVoList( Long labId, Integer state);
    
    List<MemberInfoVo> selectMemberVoListByIds(List<Long> labMemberIds);
    
    List<Long> selectMemberIds(Long labId, Integer state);

	LabMember insert(LabMember labMember);
	
	 List<LabMember> selectListByIds(List<Long> memberIds);
}
